package org.xg.assistant;

import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.spring.AiService;
import reactor.core.publisher.Flux;

import static dev.langchain4j.service.spring.AiServiceWiringMode.EXPLICIT;

/**
 * @author hans
 * @date 2025/05/09 18:03
 * @description 小智智能体
 */
@AiService(
        wiringMode = EXPLICIT,
//        chatModel = "qwenChatModel",
        // 流式输出
        streamingChatModel = "qwenStreamingChatModel",
        chatMemoryProvider = "chatMemorySmallZhiProvider",
        tools = "appointmentTools",
        // contentRetriever: 内容检索器
//        contentRetriever = "contentRetrieverSmallZhi"
        // contentRetriever: 基于 pinecone 的向量数据库
        contentRetriever = "contentRetrieverSmallZhiPineCone"
)
public interface SmallZhiAgent {

    @SystemMessage(fromResource = "small-zhi-prompt-template.txt")
//    String chat(@MemoryId Long memoryId, @UserMessage String userMessage);
    Flux<String> chat(@MemoryId Long memoryId, @UserMessage String userMessage); // 流式输出
}
